﻿Public Class CustomFTPLog
    Inherits TraceListener
    Private Shared _log As NLog.Logger = NLog.LogManager.GetLogger("FTP")

    Public Overloads Overrides Sub Write(message As String)

        Try
            _log.Info(message)
        Catch ex As Exception
            _log.Error(ex, ex.Message)
        End Try

    End Sub

    Public Overloads Overrides Sub WriteLine(message As String)

        Try
            _log.Info(message)
        Catch ex As Exception
            _log.Error(ex, ex.Message)
        End Try

    End Sub

    Public Overrides Sub Fail(message As String)
        Try
            _log.Error(message)
        Catch ex As Exception
            _log.Error(ex, ex.Message)
        End Try
    End Sub

End Class